    import com.sun.awt.AWTUtilities;

    import java.awt.*;
    import javax.swing.*;

    public class Test {

        @SuppressWarnings({ "serial" })

        public static void main(String[] args) {

            JPanel panel = new JPanel() {

                private Image img = new ImageIcon("images/ame.png").getImage();



                @Override

                public void paintComponent(Graphics g) {

                    super.paintComponent(g);

                    Graphics2D g2d = (Graphics2D) g;

                    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                     RenderingHints.VALUE_ANTIALIAS_ON);

                    g2d.setPaint(Color.red);

                    g2d.drawImage(img, 0, 0, 100, 100, null);

                }

            };



            JFrame frame = new JFrame();

            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

            frame.setUndecorated(true);

            AWTUtilities.setWindowOpaque(frame, false);

            frame.setContentPane(panel);

            //frame.setSize(500, 500); // frame不能用pack()函数

            frame.setAlwaysOnTop(true); // 窗口最前面显示

            frame.setExtendedState(JFrame.MAXIMIZED_BOTH); // 最大宽度

            frame.setLocationRelativeTo(null);

            frame.setVisible(true);

        }
    }  